home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 7 / Amiga Format AFCD07 (Dec 1996, Issue 91).iso / serious / shareware / programming / aros / dos / remdosentry.c < prev    next >
C/C++ Source or Header  |  1996-09-12  |  2KB  |  81 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: remdosentry.c,v 1.3 1996/08/13 13:52:50 digulla Exp $
  4.     $Log: remdosentry.c,v $
  5.     Revision 1.3  1996/08/13 13:52:50  digulla
  6.     Replaced <dos/dosextens.h> by "dos_intern.h" or added "dos_intern.h"
  7.     Replaced __AROS_LA by __AROS_LHA
  8.  
  9.     Revision 1.2  1996/08/01 17:40:57  digulla
  10.     Added standard header for all files
  11.  
  12.     Desc:
  13.     Lang: english
  14. */
  15. #include <dos/dosextens.h>
  16. #include <clib/utility_protos.h>
  17.  
  18. /*****************************************************************************
  19.  
  20.     NAME */
  21.     #include <clib/dos_protos.h>
  22.  
  23.     __AROS_LH1(LONG, RemDosEntry,
  24.  
  25. /*  SYNOPSIS */
  26.     __AROS_LHA(struct DosList *, dlist, D1),
  27.  
  28. /*  LOCATION */
  29.     struct DosLibrary *, DOSBase, 112, Dos)
  30.  
  31. /*  FUNCTION
  32.     Removes a given dos list entry from the dos list. Automatically
  33.     locks the list for writing.
  34.  
  35.     INPUTS
  36.     dlist - pointer to dos list entry.
  37.  
  38.     RESULT
  39.     !=0 if all went well, 0 otherwise.
  40.  
  41.     NOTES
  42.     Since anybody who wants to use a device or volume node in the
  43.     dos list has to lock the list, filesystems may be called with
  44.     the dos list locked. So if you want to add a dos list entry
  45.     out of a filesystem don't just wait on the lock but serve all
  46.     incoming requests until the dos list is free instead.
  47.  
  48.     EXAMPLE
  49.  
  50.     BUGS
  51.  
  52.     SEE ALSO
  53.  
  54.     INTERNALS
  55.  
  56.     HISTORY
  57.     29-10-95    digulla automatically created from
  58.                 dos_lib.fd and clib/dos_protos.h
  59.  
  60. *****************************************************************************/
  61. {
  62.     __AROS_FUNC_INIT
  63.     __AROS_BASE_EXT_DECL(struct DosLibrary *,DOSBase)
  64.     struct DosList *dl;
  65.  
  66.     dl=LockDosList(LDF_ALL|LDF_WRITE);
  67.     for(;;)
  68.     {
  69.         if(dl->dol_Next==dlist)
  70.     {
  71.         dl->dol_Next=dlist->dol_Next;
  72.         break;
  73.     }
  74.     dl=dl->dol_Next;
  75.     }
  76.     UnLockDosList(LDF_ALL|LDF_WRITE);
  77.  
  78.     return 1;
  79.     __AROS_FUNC_EXIT
  80. } /* RemDosEntry */
  81.